package com.wlc.base.reflexdemo;

/**
 * @author 王立朝 wanglichao@champion-credit.com
 * @description hero
 * @date 2021-08-07 11:50
 */
public class Hero extends HeroParent{

    public String name;
    private static String age;

    public void adAttack(){
        System.out.println("攻击");
    }

    public void doService1(){
        System.out.println("反射方法");
    }
    static {
        age = "张三";
        System.out.println("开始初始化：name-》" + age);
    }

    public Hero() {
        System.out.println("无参数构造方法初始化"+age);
    }

    @Override
    public String toString() {
        return "Hero{" +
                "name='" + name + '\'' +
                '}';
    }
}
